package www.xpu.edu.app;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;

import www.xpu.edu.app.job.Activity_job_1;
import www.xpu.edu.app.job.Activity_job_2;


/**
 * A simple {@link Fragment} subclass.
 */
public class Fragment2 extends Fragment {

    private View mView;
    private Button button1;
    private Button button2;

    /*@Override
    public void onDestroy() {
        super.onDestroy();
        ((ViewGroup)mView.getParent()).removeAllViews();
    }*/
    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        // return inflater.inflate(R.layout.fragment_fragment1, container, false);
        //此碎片求职者
        if(mView==null)
        {
            mView=inflater.inflate(R.layout.fragment_fragment2,container,false);
        }
        //发布职位按钮
        button1=mView.findViewById(R.id.fg2_button1);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //startActivity(new Intent(getActivity(),Activity_job.class));
                Toast.makeText(getActivity(),"跳转到发布职位按钮",Toast.LENGTH_LONG).show();
                startActivity(new Intent(getActivity(),Activity_job_1.class));
            }
        });
        button2=mView.findViewById(R.id.fg2_button2);
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               startActivity(new Intent(getActivity(),Activity_job_2.class));
                //startActivity(new Intent(getActivity(),Activity_talk.class));
            }
        });
        return mView;
    }


}
